package com.phpxiu.app.adapter.holder;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.phpxiu.app.kkylive.R;
import com.phpxiu.app.model.list.HomeDiscover;
import com.phpxiu.app.view.custom.FrescoImageView;

/**
 * Created by WuJinZhou on 2016/5/6.
 */
public class HomeDiscoverViewHolder {
    private HomeDiscover discover;
    public FrescoImageView head;
    public TextView nick;
    public TextView position;
    public ImageView stateIcon;
    public TextView online;
    public TextView topic;
    public View dividerView;
    public HomeDiscoverViewHolder(View itemView) {
        head=(FrescoImageView)itemView.findViewById(R.id.avatar_view);
        stateIcon=(ImageView)itemView.findViewById(R.id.home_discover_live_state_icon);
        online=(TextView)itemView.findViewById(R.id.online_view);
        nick=(TextView)itemView.findViewById(R.id.nick_view);
        topic=(TextView)itemView.findViewById(R.id.topic_view);
        position=(TextView)itemView.findViewById(R.id.position_title_view);
        dividerView=itemView.findViewById(R.id.divider_view);
    }

    /**
     * 隐藏分割线
     * @param isHide
     */
    public void hideDivider(boolean isHide){
        if(isHide){
            if(dividerView.getVisibility()==View.VISIBLE){
                dividerView.setVisibility(View.INVISIBLE);
            }
        }else{
            if(dividerView.getVisibility()!=View.VISIBLE){
                dividerView.setVisibility(View.VISIBLE);
            }
        }
    }

    public HomeDiscover getDiscover() {
        return discover;
    }

    public void setDiscover(HomeDiscover discover) {
        this.discover = discover;
    }
}
